-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-783 Fix tests failing on non standard environment #432
Conversation
.to_string_lossy() | ||
.to_string(), | ||
); | ||
let _create_data_dir = create_dir_all(&data_dir); | ||
let config_file_relative = File::create(data_dir.join("config.toml")).unwrap(); | ||
fill_up_config_file(config_file_relative); | ||
let env_vec_array = vec![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot write it lower than here but I continue to think that the DirsWrapperMock doesn't belong in here, it should only be the real one. The code should figure out home_dir and data_dir on its own, genuinely. It would be possible that the test wouldn't pass for that reason of what the tests claims but just because you determined it by these supplied values in the Mock. If I'm wrong and the test fails then... I'd be disappointed... but I think we'll have to think that out even further.
"node_configurator_standard", | ||
"tilde_in_config_file_path_from_commandline_and_args_uploaded_from_config_file", | ||
); | ||
let home_dir = base_dir.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have overlooked, it is possible, but it seems to me that you actually don't need to create this "base_dir" first and then the "home_dir". I might be able to write directly:
let home_dir = ensure_node_home_directory_exists(
"node_configurator_standard",
"tilde_in_config_file_path_from_commandline_and_args_uploaded_from_config_file",
);
.expect("expect home dir") | ||
.join("masqhome") | ||
.join("config.toml"); | ||
let mut config_file = File::create(&config_file_path).unwrap(); | ||
config_file | ||
.write_all(b"blockchain-service-url = \"https://www.mainnet.com\"\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned it at the other test already, please try eliminating the DirsWrapperMock
.
…mandline_and_args_uploaded_from_config_file
…rapperReal and simplifying home_dir creation
…path_from_commandline_and_args_uploaded_from_config_file
…mmandline_and_args_uploaded_from_config_file
…ir for DirsWrapperMock
No description provided.